(0) Obligation:

Runtime Complexity TRS:
The TRS R consists of the following rules:

last(nil) → 0
last(cons(x, nil)) → x
last(cons(x, cons(y, xs))) → last(cons(y, xs))
del(x, nil) → nil
del(x, cons(y, xs)) → if(eq(x, y), x, y, xs)
if(true, x, y, xs) → xs
if(false, x, y, xs) → cons(y, del(x, xs))
eq(0, 0) → true
eq(0, s(y)) → false
eq(s(x), 0) → false
eq(s(x), s(y)) → eq(x, y)
reverse(nil) → nil
reverse(cons(x, xs)) → cons(last(cons(x, xs)), reverse(del(last(cons(x, xs)), cons(x, xs))))

Rewrite Strategy: INNERMOST

(1) RenamingProof (EQUIVALENT transformation)

Renamed function symbols to avoid clashes with predefined symbol.

(2) Obligation:

Runtime Complexity Relative TRS:
The TRS R consists of the following rules:

last(nil) → 0'
last(cons(x, nil)) → x
last(cons(x, cons(y, xs))) → last(cons(y, xs))
del(x, nil) → nil
del(x, cons(y, xs)) → if(eq(x, y), x, y, xs)
if(true, x, y, xs) → xs
if(false, x, y, xs) → cons(y, del(x, xs))
eq(0', 0') → true
eq(0', s(y)) → false
eq(s(x), 0') → false
eq(s(x), s(y)) → eq(x, y)
reverse(nil) → nil
reverse(cons(x, xs)) → cons(last(cons(x, xs)), reverse(del(last(cons(x, xs)), cons(x, xs))))

S is empty.
Rewrite Strategy: INNERMOST

(3) TypeInferenceProof (BOTH BOUNDS(ID, ID) transformation)

Infered types.

(4) Obligation:

Innermost TRS:
Rules:
last(nil) → 0'
last(cons(x, nil)) → x
last(cons(x, cons(y, xs))) → last(cons(y, xs))
del(x, nil) → nil
del(x, cons(y, xs)) → if(eq(x, y), x, y, xs)
if(true, x, y, xs) → xs
if(false, x, y, xs) → cons(y, del(x, xs))
eq(0', 0') → true
eq(0', s(y)) → false
eq(s(x), 0') → false
eq(s(x), s(y)) → eq(x, y)
reverse(nil) → nil
reverse(cons(x, xs)) → cons(last(cons(x, xs)), reverse(del(last(cons(x, xs)), cons(x, xs))))

Types:
last :: nil:cons → 0':s
nil :: nil:cons
0' :: 0':s
cons :: 0':s → nil:cons → nil:cons
del :: 0':s → nil:cons → nil:cons
if :: true:false → 0':s → 0':s → nil:cons → nil:cons
eq :: 0':s → 0':s → true:false
true :: true:false
false :: true:false
s :: 0':s → 0':s
reverse :: nil:cons → nil:cons
hole_0':s1_0 :: 0':s
hole_nil:cons2_0 :: nil:cons
hole_true:false3_0 :: true:false
gen_0':s4_0 :: Nat → 0':s
gen_nil:cons5_0 :: Nat → nil:cons

(5) OrderProof (LOWER BOUND(ID) transformation)

Heuristically decided to analyse the following defined symbols:
last, del, eq, reverse

They will be analysed ascendingly in the following order:
last < reverse
eq < del
del < reverse

(6) Obligation:

Innermost TRS:
Rules:
last(nil) → 0'
last(cons(x, nil)) → x
last(cons(x, cons(y, xs))) → last(cons(y, xs))
del(x, nil) → nil
del(x, cons(y, xs)) → if(eq(x, y), x, y, xs)
if(true, x, y, xs) → xs
if(false, x, y, xs) → cons(y, del(x, xs))
eq(0', 0') → true
eq(0', s(y)) → false
eq(s(x), 0') → false
eq(s(x), s(y)) → eq(x, y)
reverse(nil) → nil
reverse(cons(x, xs)) → cons(last(cons(x, xs)), reverse(del(last(cons(x, xs)), cons(x, xs))))

Types:
last :: nil:cons → 0':s
nil :: nil:cons
0' :: 0':s
cons :: 0':s → nil:cons → nil:cons
del :: 0':s → nil:cons → nil:cons
if :: true:false → 0':s → 0':s → nil:cons → nil:cons
eq :: 0':s → 0':s → true:false
true :: true:false
false :: true:false
s :: 0':s → 0':s
reverse :: nil:cons → nil:cons
hole_0':s1_0 :: 0':s
hole_nil:cons2_0 :: nil:cons
hole_true:false3_0 :: true:false
gen_0':s4_0 :: Nat → 0':s
gen_nil:cons5_0 :: Nat → nil:cons

Generator Equations:
gen_0':s4_0(0) ⇔ 0'
gen_0':s4_0(+(x, 1)) ⇔ s(gen_0':s4_0(x))
gen_nil:cons5_0(0) ⇔ nil
gen_nil:cons5_0(+(x, 1)) ⇔ cons(0', gen_nil:cons5_0(x))

The following defined symbols remain to be analysed:
last, del, eq, reverse

They will be analysed ascendingly in the following order:
last < reverse
eq < del
del < reverse

(7) RewriteLemmaProof (LOWER BOUND(ID) transformation)

Proved the following rewrite lemma:
last(gen_nil:cons5_0(+(1, n7_0))) → gen_0':s4_0(0), rt ∈ Ω(1 + n70)

Induction Base:
last(gen_nil:cons5_0(+(1, 0))) →RΩ(1)
0'

Induction Step:
last(gen_nil:cons5_0(+(1, +(n7_0, 1)))) →RΩ(1)
last(cons(0', gen_nil:cons5_0(n7_0))) →IH
gen_0':s4_0(0)

We have rt ∈ Ω(n1) and sz ∈ O(n). Thus, we have ircR ∈ Ω(n).

(8) Complex Obligation (BEST)

(9) Obligation:

Innermost TRS:
Rules:
last(nil) → 0'
last(cons(x, nil)) → x
last(cons(x, cons(y, xs))) → last(cons(y, xs))
del(x, nil) → nil
del(x, cons(y, xs)) → if(eq(x, y), x, y, xs)
if(true, x, y, xs) → xs
if(false, x, y, xs) → cons(y, del(x, xs))
eq(0', 0') → true
eq(0', s(y)) → false
eq(s(x), 0') → false
eq(s(x), s(y)) → eq(x, y)
reverse(nil) → nil
reverse(cons(x, xs)) → cons(last(cons(x, xs)), reverse(del(last(cons(x, xs)), cons(x, xs))))

Types:
last :: nil:cons → 0':s
nil :: nil:cons
0' :: 0':s
cons :: 0':s → nil:cons → nil:cons
del :: 0':s → nil:cons → nil:cons
if :: true:false → 0':s → 0':s → nil:cons → nil:cons
eq :: 0':s → 0':s → true:false
true :: true:false
false :: true:false
s :: 0':s → 0':s
reverse :: nil:cons → nil:cons
hole_0':s1_0 :: 0':s
hole_nil:cons2_0 :: nil:cons
hole_true:false3_0 :: true:false
gen_0':s4_0 :: Nat → 0':s
gen_nil:cons5_0 :: Nat → nil:cons

Lemmas:
last(gen_nil:cons5_0(+(1, n7_0))) → gen_0':s4_0(0), rt ∈ Ω(1 + n70)

Generator Equations:
gen_0':s4_0(0) ⇔ 0'
gen_0':s4_0(+(x, 1)) ⇔ s(gen_0':s4_0(x))
gen_nil:cons5_0(0) ⇔ nil
gen_nil:cons5_0(+(x, 1)) ⇔ cons(0', gen_nil:cons5_0(x))

The following defined symbols remain to be analysed:
eq, del, reverse

They will be analysed ascendingly in the following order:
eq < del
del < reverse

(10) RewriteLemmaProof (LOWER BOUND(ID) transformation)

Proved the following rewrite lemma:
eq(gen_0':s4_0(n356_0), gen_0':s4_0(n356_0)) → true, rt ∈ Ω(1 + n3560)

Induction Base:
eq(gen_0':s4_0(0), gen_0':s4_0(0)) →RΩ(1)
true

Induction Step:
eq(gen_0':s4_0(+(n356_0, 1)), gen_0':s4_0(+(n356_0, 1))) →RΩ(1)
eq(gen_0':s4_0(n356_0), gen_0':s4_0(n356_0)) →IH
true

We have rt ∈ Ω(n1) and sz ∈ O(n). Thus, we have ircR ∈ Ω(n).

(11) Complex Obligation (BEST)

(12) Obligation:

Innermost TRS:
Rules:
last(nil) → 0'
last(cons(x, nil)) → x
last(cons(x, cons(y, xs))) → last(cons(y, xs))
del(x, nil) → nil
del(x, cons(y, xs)) → if(eq(x, y), x, y, xs)
if(true, x, y, xs) → xs
if(false, x, y, xs) → cons(y, del(x, xs))
eq(0', 0') → true
eq(0', s(y)) → false
eq(s(x), 0') → false
eq(s(x), s(y)) → eq(x, y)
reverse(nil) → nil
reverse(cons(x, xs)) → cons(last(cons(x, xs)), reverse(del(last(cons(x, xs)), cons(x, xs))))

Types:
last :: nil:cons → 0':s
nil :: nil:cons
0' :: 0':s
cons :: 0':s → nil:cons → nil:cons
del :: 0':s → nil:cons → nil:cons
if :: true:false → 0':s → 0':s → nil:cons → nil:cons
eq :: 0':s → 0':s → true:false
true :: true:false
false :: true:false
s :: 0':s → 0':s
reverse :: nil:cons → nil:cons
hole_0':s1_0 :: 0':s
hole_nil:cons2_0 :: nil:cons
hole_true:false3_0 :: true:false
gen_0':s4_0 :: Nat → 0':s
gen_nil:cons5_0 :: Nat → nil:cons

Lemmas:
last(gen_nil:cons5_0(+(1, n7_0))) → gen_0':s4_0(0), rt ∈ Ω(1 + n70)
eq(gen_0':s4_0(n356_0), gen_0':s4_0(n356_0)) → true, rt ∈ Ω(1 + n3560)

Generator Equations:
gen_0':s4_0(0) ⇔ 0'
gen_0':s4_0(+(x, 1)) ⇔ s(gen_0':s4_0(x))
gen_nil:cons5_0(0) ⇔ nil
gen_nil:cons5_0(+(x, 1)) ⇔ cons(0', gen_nil:cons5_0(x))

The following defined symbols remain to be analysed:
del, reverse

They will be analysed ascendingly in the following order:
del < reverse

(13) NoRewriteLemmaProof (LOWER BOUND(ID) transformation)

Could not prove a rewrite lemma for the defined symbol del.

(14) Obligation:

Innermost TRS:
Rules:
last(nil) → 0'
last(cons(x, nil)) → x
last(cons(x, cons(y, xs))) → last(cons(y, xs))
del(x, nil) → nil
del(x, cons(y, xs)) → if(eq(x, y), x, y, xs)
if(true, x, y, xs) → xs
if(false, x, y, xs) → cons(y, del(x, xs))
eq(0', 0') → true
eq(0', s(y)) → false
eq(s(x), 0') → false
eq(s(x), s(y)) → eq(x, y)
reverse(nil) → nil
reverse(cons(x, xs)) → cons(last(cons(x, xs)), reverse(del(last(cons(x, xs)), cons(x, xs))))

Types:
last :: nil:cons → 0':s
nil :: nil:cons
0' :: 0':s
cons :: 0':s → nil:cons → nil:cons
del :: 0':s → nil:cons → nil:cons
if :: true:false → 0':s → 0':s → nil:cons → nil:cons
eq :: 0':s → 0':s → true:false
true :: true:false
false :: true:false
s :: 0':s → 0':s
reverse :: nil:cons → nil:cons
hole_0':s1_0 :: 0':s
hole_nil:cons2_0 :: nil:cons
hole_true:false3_0 :: true:false
gen_0':s4_0 :: Nat → 0':s
gen_nil:cons5_0 :: Nat → nil:cons

Lemmas:
last(gen_nil:cons5_0(+(1, n7_0))) → gen_0':s4_0(0), rt ∈ Ω(1 + n70)
eq(gen_0':s4_0(n356_0), gen_0':s4_0(n356_0)) → true, rt ∈ Ω(1 + n3560)

Generator Equations:
gen_0':s4_0(0) ⇔ 0'
gen_0':s4_0(+(x, 1)) ⇔ s(gen_0':s4_0(x))
gen_nil:cons5_0(0) ⇔ nil
gen_nil:cons5_0(+(x, 1)) ⇔ cons(0', gen_nil:cons5_0(x))

The following defined symbols remain to be analysed:
reverse

(15) RewriteLemmaProof (LOWER BOUND(ID) transformation)

Proved the following rewrite lemma:
reverse(gen_nil:cons5_0(n953_0)) → gen_nil:cons5_0(n953_0), rt ∈ Ω(1 + n9530 + n95302)

Induction Base:
reverse(gen_nil:cons5_0(0)) →RΩ(1)
nil

Induction Step:
reverse(gen_nil:cons5_0(+(n953_0, 1))) →RΩ(1)
cons(last(cons(0', gen_nil:cons5_0(n953_0))), reverse(del(last(cons(0', gen_nil:cons5_0(n953_0))), cons(0', gen_nil:cons5_0(n953_0))))) →LΩ(1 + n9530)
cons(gen_0':s4_0(0), reverse(del(last(cons(0', gen_nil:cons5_0(n953_0))), cons(0', gen_nil:cons5_0(n953_0))))) →LΩ(1 + n9530)
cons(gen_0':s4_0(0), reverse(del(gen_0':s4_0(0), cons(0', gen_nil:cons5_0(n953_0))))) →RΩ(1)
cons(gen_0':s4_0(0), reverse(if(eq(gen_0':s4_0(0), 0'), gen_0':s4_0(0), 0', gen_nil:cons5_0(n953_0)))) →LΩ(1)
cons(gen_0':s4_0(0), reverse(if(true, gen_0':s4_0(0), 0', gen_nil:cons5_0(n953_0)))) →RΩ(1)
cons(gen_0':s4_0(0), reverse(gen_nil:cons5_0(n953_0))) →IH
cons(gen_0':s4_0(0), gen_nil:cons5_0(c954_0))

We have rt ∈ Ω(n2) and sz ∈ O(n). Thus, we have ircR ∈ Ω(n2).

(16) Complex Obligation (BEST)

(17) Obligation:

Innermost TRS:
Rules:
last(nil) → 0'
last(cons(x, nil)) → x
last(cons(x, cons(y, xs))) → last(cons(y, xs))
del(x, nil) → nil
del(x, cons(y, xs)) → if(eq(x, y), x, y, xs)
if(true, x, y, xs) → xs
if(false, x, y, xs) → cons(y, del(x, xs))
eq(0', 0') → true
eq(0', s(y)) → false
eq(s(x), 0') → false
eq(s(x), s(y)) → eq(x, y)
reverse(nil) → nil
reverse(cons(x, xs)) → cons(last(cons(x, xs)), reverse(del(last(cons(x, xs)), cons(x, xs))))

Types:
last :: nil:cons → 0':s
nil :: nil:cons
0' :: 0':s
cons :: 0':s → nil:cons → nil:cons
del :: 0':s → nil:cons → nil:cons
if :: true:false → 0':s → 0':s → nil:cons → nil:cons
eq :: 0':s → 0':s → true:false
true :: true:false
false :: true:false
s :: 0':s → 0':s
reverse :: nil:cons → nil:cons
hole_0':s1_0 :: 0':s
hole_nil:cons2_0 :: nil:cons
hole_true:false3_0 :: true:false
gen_0':s4_0 :: Nat → 0':s
gen_nil:cons5_0 :: Nat → nil:cons

Lemmas:
last(gen_nil:cons5_0(+(1, n7_0))) → gen_0':s4_0(0), rt ∈ Ω(1 + n70)
eq(gen_0':s4_0(n356_0), gen_0':s4_0(n356_0)) → true, rt ∈ Ω(1 + n3560)
reverse(gen_nil:cons5_0(n953_0)) → gen_nil:cons5_0(n953_0), rt ∈ Ω(1 + n9530 + n95302)

Generator Equations:
gen_0':s4_0(0) ⇔ 0'
gen_0':s4_0(+(x, 1)) ⇔ s(gen_0':s4_0(x))
gen_nil:cons5_0(0) ⇔ nil
gen_nil:cons5_0(+(x, 1)) ⇔ cons(0', gen_nil:cons5_0(x))

No more defined symbols left to analyse.

(18) LowerBoundsProof (EQUIVALENT transformation)

The lowerbound Ω(n2) was proven with the following lemma:
reverse(gen_nil:cons5_0(n953_0)) → gen_nil:cons5_0(n953_0), rt ∈ Ω(1 + n9530 + n95302)

(19) BOUNDS(n^2, INF)

(20) Obligation:

Innermost TRS:
Rules:
last(nil) → 0'
last(cons(x, nil)) → x
last(cons(x, cons(y, xs))) → last(cons(y, xs))
del(x, nil) → nil
del(x, cons(y, xs)) → if(eq(x, y), x, y, xs)
if(true, x, y, xs) → xs
if(false, x, y, xs) → cons(y, del(x, xs))
eq(0', 0') → true
eq(0', s(y)) → false
eq(s(x), 0') → false
eq(s(x), s(y)) → eq(x, y)
reverse(nil) → nil
reverse(cons(x, xs)) → cons(last(cons(x, xs)), reverse(del(last(cons(x, xs)), cons(x, xs))))

Types:
last :: nil:cons → 0':s
nil :: nil:cons
0' :: 0':s
cons :: 0':s → nil:cons → nil:cons
del :: 0':s → nil:cons → nil:cons
if :: true:false → 0':s → 0':s → nil:cons → nil:cons
eq :: 0':s → 0':s → true:false
true :: true:false
false :: true:false
s :: 0':s → 0':s
reverse :: nil:cons → nil:cons
hole_0':s1_0 :: 0':s
hole_nil:cons2_0 :: nil:cons
hole_true:false3_0 :: true:false
gen_0':s4_0 :: Nat → 0':s
gen_nil:cons5_0 :: Nat → nil:cons

Lemmas:
last(gen_nil:cons5_0(+(1, n7_0))) → gen_0':s4_0(0), rt ∈ Ω(1 + n70)
eq(gen_0':s4_0(n356_0), gen_0':s4_0(n356_0)) → true, rt ∈ Ω(1 + n3560)
reverse(gen_nil:cons5_0(n953_0)) → gen_nil:cons5_0(n953_0), rt ∈ Ω(1 + n9530 + n95302)

Generator Equations:
gen_0':s4_0(0) ⇔ 0'
gen_0':s4_0(+(x, 1)) ⇔ s(gen_0':s4_0(x))
gen_nil:cons5_0(0) ⇔ nil
gen_nil:cons5_0(+(x, 1)) ⇔ cons(0', gen_nil:cons5_0(x))

No more defined symbols left to analyse.

(21) LowerBoundsProof (EQUIVALENT transformation)

The lowerbound Ω(n2) was proven with the following lemma:
reverse(gen_nil:cons5_0(n953_0)) → gen_nil:cons5_0(n953_0), rt ∈ Ω(1 + n9530 + n95302)

(22) BOUNDS(n^2, INF)

(23) Obligation:

Innermost TRS:
Rules:
last(nil) → 0'
last(cons(x, nil)) → x
last(cons(x, cons(y, xs))) → last(cons(y, xs))
del(x, nil) → nil
del(x, cons(y, xs)) → if(eq(x, y), x, y, xs)
if(true, x, y, xs) → xs
if(false, x, y, xs) → cons(y, del(x, xs))
eq(0', 0') → true
eq(0', s(y)) → false
eq(s(x), 0') → false
eq(s(x), s(y)) → eq(x, y)
reverse(nil) → nil
reverse(cons(x, xs)) → cons(last(cons(x, xs)), reverse(del(last(cons(x, xs)), cons(x, xs))))

Types:
last :: nil:cons → 0':s
nil :: nil:cons
0' :: 0':s
cons :: 0':s → nil:cons → nil:cons
del :: 0':s → nil:cons → nil:cons
if :: true:false → 0':s → 0':s → nil:cons → nil:cons
eq :: 0':s → 0':s → true:false
true :: true:false
false :: true:false
s :: 0':s → 0':s
reverse :: nil:cons → nil:cons
hole_0':s1_0 :: 0':s
hole_nil:cons2_0 :: nil:cons
hole_true:false3_0 :: true:false
gen_0':s4_0 :: Nat → 0':s
gen_nil:cons5_0 :: Nat → nil:cons

Lemmas:
last(gen_nil:cons5_0(+(1, n7_0))) → gen_0':s4_0(0), rt ∈ Ω(1 + n70)
eq(gen_0':s4_0(n356_0), gen_0':s4_0(n356_0)) → true, rt ∈ Ω(1 + n3560)

Generator Equations:
gen_0':s4_0(0) ⇔ 0'
gen_0':s4_0(+(x, 1)) ⇔ s(gen_0':s4_0(x))
gen_nil:cons5_0(0) ⇔ nil
gen_nil:cons5_0(+(x, 1)) ⇔ cons(0', gen_nil:cons5_0(x))

No more defined symbols left to analyse.

(24) LowerBoundsProof (EQUIVALENT transformation)

The lowerbound Ω(n1) was proven with the following lemma:
last(gen_nil:cons5_0(+(1, n7_0))) → gen_0':s4_0(0), rt ∈ Ω(1 + n70)

(25) BOUNDS(n^1, INF)

(26) Obligation:

Innermost TRS:
Rules:
last(nil) → 0'
last(cons(x, nil)) → x
last(cons(x, cons(y, xs))) → last(cons(y, xs))
del(x, nil) → nil
del(x, cons(y, xs)) → if(eq(x, y), x, y, xs)
if(true, x, y, xs) → xs
if(false, x, y, xs) → cons(y, del(x, xs))
eq(0', 0') → true
eq(0', s(y)) → false
eq(s(x), 0') → false
eq(s(x), s(y)) → eq(x, y)
reverse(nil) → nil
reverse(cons(x, xs)) → cons(last(cons(x, xs)), reverse(del(last(cons(x, xs)), cons(x, xs))))

Types:
last :: nil:cons → 0':s
nil :: nil:cons
0' :: 0':s
cons :: 0':s → nil:cons → nil:cons
del :: 0':s → nil:cons → nil:cons
if :: true:false → 0':s → 0':s → nil:cons → nil:cons
eq :: 0':s → 0':s → true:false
true :: true:false
false :: true:false
s :: 0':s → 0':s
reverse :: nil:cons → nil:cons
hole_0':s1_0 :: 0':s
hole_nil:cons2_0 :: nil:cons
hole_true:false3_0 :: true:false
gen_0':s4_0 :: Nat → 0':s
gen_nil:cons5_0 :: Nat → nil:cons

Lemmas:
last(gen_nil:cons5_0(+(1, n7_0))) → gen_0':s4_0(0), rt ∈ Ω(1 + n70)

Generator Equations:
gen_0':s4_0(0) ⇔ 0'
gen_0':s4_0(+(x, 1)) ⇔ s(gen_0':s4_0(x))
gen_nil:cons5_0(0) ⇔ nil
gen_nil:cons5_0(+(x, 1)) ⇔ cons(0', gen_nil:cons5_0(x))

No more defined symbols left to analyse.

(27) LowerBoundsProof (EQUIVALENT transformation)

The lowerbound Ω(n1) was proven with the following lemma:
last(gen_nil:cons5_0(+(1, n7_0))) → gen_0':s4_0(0), rt ∈ Ω(1 + n70)

(28) BOUNDS(n^1, INF)